package com.aaron.exception;


import com.aaron.enums.RpcErrorMessageEnum;

//RPC调用异常
public class RpcException extends RuntimeException {
    //super()是调用调用其父类RuntimeException中的初始化方法。最后貌似是传递到了Throwable类处理了。
    public RpcException(RpcErrorMessageEnum rpcErrorMessageEnum, String detail) {
        super(rpcErrorMessageEnum.getMessage() + ":" + detail);
    }

    public RpcException(String message, Throwable cause) {
        super(message, cause);
    }

    public RpcException(RpcErrorMessageEnum rpcErrorMessageEnum) {
        super(rpcErrorMessageEnum.getMessage());
    }
}
